package cn.iocoder.yudao.module.reading.controller.app.assignment.vo;

import cn.iocoder.yudao.module.reading.framework.vo.BaseUrlConvertVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 可选绘本信息 Response VO
 *
 * @author 芋道源码
 */
@Schema(description = "用户 APP - 可选绘本信息 Response VO")
@Data
@EqualsAndHashCode(callSuper = false)
public class SelectableBookRespVO extends BaseUrlConvertVO {

    @Schema(description = "绘本ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long id;

    @Schema(description = "绘本标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "Muddy Puddles")
    private String title;

    @Schema(description = "绘本封面", example = "/static/books/peppa_01.jpg")
    private String cover;

    @Schema(description = "语言类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "english")
    private String language;

    @Schema(description = "绘本集ID", example = "1")
    private Long bookSetId;

    @Schema(description = "绘本集标题", example = "小猪佩奇系列")
    private String bookSetTitle;

    @Schema(description = "绘本集封面", example = "/static/book-sets/peppa_cover.jpg")
    private String bookSetCover;

    @Schema(description = "绘本页数", example = "24")
    private Integer pages;

    /**
     * 转换URL字段
     * 将相对路径转换为完整URL
     */
    @Override
    public void convertUrls() {
        this.cover = convertUrl(this.cover);
        this.bookSetCover = convertUrl(this.bookSetCover);
    }

}
